{echo:JS::import('dialog?skin=brief');}
{echo:JS::import('dialogtools');}
{echo:JS::import('form');}
<form name="zform" action="" method="post">
    <div class="tools_bar clearfix">

        <a class="icon-delicious" href="{url:/customer/active_list}"> 全部用户</a>
        <span class="fr"><a href='javascript:;' id="condition" class="icon-search" style=""> 筛选条件</a><input
                id="condition_input" type="hidden" name="condition" value="{$condition}"></span>
    </div>
    <table class="default">
        <tr>
            <th>复投用户</th>
            <th>复投方式</th>
            <th>复投总金额</th>
            <th>扣除现金分</th>
            <th>扣除注册分</th>
            <th>复投时间</th>

        </tr>
        {query:name = active_ft_list as a, user as u fields =a.*,u.name as name  where=a.user_id eq u.id and a.post eq 2 and $where id=$obj page=1 pagesize=13 order= a.user_id
        desc }
        <tr>
            <td>
                {echo:Common::getUid($item['user_id'])['name']}
            </td>

            <td>
                {if: intval($item['method']) ==1 }
                100%现金分
                {/if}
                {if: intval($item['method']) ==2 }
                80%现金分 + 20%注册分
                {/if}
            </td>

            <td>
                {if:$item['zje']>0}
                <b style="color:red">
                    {$item['zje']}
                </b>
                {else:}
                {$item['zje']}
                {/if}
            </td>
            <td>
                {if:$item['xjf']>0}
                <b style="color:red">
                    {$item['xjf']}
                </b>
                {else:}
                {$item['xjf']}
                {/if}
            </td>
            <td>
                {if:$item['zcf']>0}
                <b style="color:red">
                    {$item['zcf']}
                </b>
                {else:}
                {$item['zcf']}
                {/if}
            </td>

            <td>{$item['time']}</td>

        </tr>
        {/query}
    </table>
</form>
<div class="page_nav">
    {echo:$obj->pageBar()}
</div>




<script type="text/javascript">
    function view(id){
        art.dialog.open("{url:/customer/dp_view/id/}"+id,{id:'edit_dialog',title:'店铺信息',resize:false,width:500,height:300});
    }

    function close(){
        art.dialog({id:'edit_dialog'}).close();
        art.dialog.tips("<p class='success'>设置成功！</p>");
        window.location.reload();
    }

    //将输入的数字金额转换成对应的中文大写金额
    //idNumber输入的数字金额，idCHN输出的中文大写金额
    function TransformNumberIntoCHN(number) {
        if (!/^(0|[1-9]\d*)(\.\d{1,2})?$/.test(number)) {

            return false;
        }
        var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
        number += "00";
        var point = number.indexOf('.');
        if (point >= 0) {
            number = number.substring(0, point) + number.substr(point + 1, 2);
        }
        unit = unit.substr(unit.length - number.length);
        for (var i = 0; i < number.length; i++) {
            str += '零壹贰叁肆伍陆柒捌玖'.charAt(number.charAt(i)) + unit.charAt(i);
        }
        //document.getElementById(idCHN).value = str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
        return str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
    }

    $(function () {
        $("#amount").blur(function () {
            var amount = $("#amount").val();
            if (isNaN(amount) || amount == '') {
                $("#lb_msg").text('');
                return;
            }
            var dxje = TransformNumberIntoCHN(amount);
            $("#lb_msg").text(dxje);
        });
    });


    function balance_op(user_id, type) {
        $("#user_id").val(user_id);
        $("#type").val(type);
        var title = "充值";
        if (type == 4) title = "扣款";
        $("#balance-title").text(title);
        $("#balance-btn").text(title);
        $("#amount").val('');
        art.dialog({
            id: 'balance_op',
            lock: true,
            opacity: 0.1,
            title: title,
            width: 600,
            height: 200,
            padding: "15px",
            content: document.getElementById("balance_box")
        });
    }
    function create_voucher(e) {
        if (e == null) {
            $("#balance-btn").attr("disabled", true);
            var fields = $("#export_form").serializeArray();
            $.get("{url:/customer/balance_op}", fields, function (data) {
                if (data['status'] == 'success') {
                    art.dialog({id: 'balance_op'}).close();
                    art.dialog.tips("<p class='" + data['status'] + "'>" + data['msg'] + "</p>", 2);
                    setTimeout("tools_reload()", 2000);
                } else {
                    art.dialog.tips("<p class='" + data['status'] + "'>" + data['msg'] + "</p>");
                }
                $("#balance-btn").attr("disabled", false);
            }, 'json');
        }
        return false;
    }
</script>

<script type="text/javascript">
    var form = new Form();
    $("#condition").on("click", function () {
        //$("body").Condition({input:"#condition_input",okVal:'高级搜索',callback:function(data){tools_submit({action:'{url:/customer/customer_list}',method:'get'});},data:{'name':{name:'账号'},real_name:{name:'姓名'},status:{name:'是否锁定',values:{1:'正常',2:'锁定'}},nojj:{name:'是否冻结',values:{0:'正常',1:'冻结'}},u_lx:{name:'身份',values:{0:'普通',1:'创客',2:'商家'}},mobile:{name:'手机号码'},reg_time:{name:'注册时间'}
        $("body").Condition({
            input: "#condition_input", okVal: '高级搜索', callback: function (data) {
                tools_submit({action: '{url:/customer/active_list}', method: 'get'});
            }, data: {
                'name': {name: '账号'},
//                real_name: {name: '姓名'},
//                status: {name: '是否锁定', values: {1: '正常', 2: '锁定'}},
//                nojj: {name: '是否冻结', values: {0: '正常', 1: '冻结'}},
////                u_lx: {name: '身份', values: {0: '普通', 1: '服务中心', 2: '分公司'}},
//                zcf: {name: '注册分'},
//                jjf: {name: '奖金分'},
//                xjf: {name: '现金分'},
//                gwjf: {name: '购物积分'},
//                cxjf: {name: '重消积分'},
//                zc: {name: '资产'},
//                last_fhjf: {name: '剩余分红积分'},
                time: {name: '注册时间'},
//                group_id: {name:'投资级别', values: {1: '一级代理', 2: '二级代理', 3: '县代理',4:'市代理'}}
            }
        });
    });
</script>
